<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="t" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
    	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/message.css" />
    	
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <style>
        	
        </style>
    </head>

    <body>
    <div class="body">
        <div class="head">
            <nav id="top-nav" >
                <form method="GET" name="frmKey" action="search.asp?action=search">

                    <div class="wrapper" >
                        <div class="inner-wrapper">

                            <div class="search-box bdwm-search-box">

                                <input type="hidden" name="searchtime" value="0">
                                <input type="hidden" name="bbs" value="0">
                                <input type="hidden" name="action" size="20" value="search">

                                <input class="search-ipt" type="text" name="key" placeholder="搜索帖子主题" autocomplete="off">

                                <img onclick="javascript:sss();" src="images/home/iconfont-sousuo.png" class="search-btn">

                                <!--
<img class="search-btn" src="images/home/iconfont-sousuo.png">
<input  type=submit value="搜索" class="button" >-->

                                <ul class="search-result box-shadow keywords-result">
                                </ul>
                                <ul class="search-result box-shadow history-result">
                                </ul>
                            </div>
                            <div class="top-right-links">
                                <a href="">首页</a>
                                <a href="online.asp">我的信息</a>
                            </div>
                        </div>
                    </div>

                </form>
                <script language="javascript">
                    function sss() {
                        frmKey.submit();
                    }
                </script>
            </nav>
        </div>



        <t:choose>
<%--            update为真去修改页面，为空去普通帖子--%>
            <t:when test="${update!=null}">
                <div class="evaluate">
                    <label class="label">修改内容</label>
                    <div class="input-block">
                        <form action="${pageContext.request.contextPath}/message/updateMessage">

                            <input type="hidden" name="messageID" value="${messageData.messageID}">
                            <textarea  class="textarea" name="messageContent" >${messageData.messageContent}</textarea>
                            <div class="input-block" style="width: 350px;font-size:25px;">
                                <select name="moduleName">
                                    <t:forEach items="${sessionScope.get('moduleList')}" var="module"  >
                                        <option value="${module.moduleName}">${module.moduleName}</option>
                                    </t:forEach>
                                </select>
                            </div>
                            <div class="item">
                                <div class="input-block">
                                    <button type="submit" class="button1">修改</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </t:when>
            <t:otherwise>
                <div class="mid-body">
                    <div class="message">
                        <div class="messageName">${messageData.messageName}</div>
                        <div class="users">
                            <div class="user">${userName}</div>
                            <div class="user">${messageData.moduleName}</div>
                            <div class="user1">${messageData.postingTime}</div>
                        </div>
                        <div class="messageContent">${messageData.messageContent}</div>
                        <div class="kk">
                            <div class="email">${email}</div>
                            <div class="auditSatus">${auditStatus}</div>
                        </div>
                    </div>
                    <div class="evaluate">
                        <label class="label">发表评论</label>
                        <div class="input-block">
                            <form action="${pageContext.request.contextPath}/message/addEvaluate">
                                <input type="hidden" name="messageID" value="${messageData.messageID}">
                                <input type="hidden" name="userID" value="${sessionScope.get('sessionUser').userID}">
                                <textarea placeholder="请输入评论内容" name="comments" class="textarea"></textarea>
                                <div class="item">
                                    <div class="input-block">
                                        <button type="submit" class="button1">发表</button>
                                    </div>
                                </div>
                            </form>


                        </div>
                    </div>
                    <label class="label">评论内容</label>
                    <div class="comments">
                        <t:forEach items="${eList}" var="e" varStatus="s" >
                            ${e.comments} </br>

                        </t:forEach>
                    </div>
                </div>
            </t:otherwise>
        </t:choose>




    </div>

 	</body>

</html>